set(CAL_MQTT_INCLUDE_KAWAII 0)
set(CAL_MQTT_INCLUDE_PAHO 0)
set(CAL_MQTT_INCLUDE_MODEM 0)
set(CAL_MQTT_INCLUDE_MONGOOSE 1)

###头文件
if(${CAL_MQTT_INCLUDE_KAWAII})
message("==========kawaii include ")
include_directories(mqtt_kawaii/kawaii-mqtt/mqttclient)
include_directories(mqtt_kawaii/kawaii-mqtt/mqtt)
include_directories(mqtt_kawaii/kawaii-mqtt/network)

elseif(${CAL_MQTT_INCLUDE_PAHO})
message("==========paho include ")
include_directories(mqtt_paho/paho.mqtt.c/src)

elseif(${CAL_MQTT_INCLUDE_MODEM})
message("==========modem include ")

elseif(${CAL_MQTT_INCLUDE_MONGOOSE})
message("==========mongoose include ")
include_directories(../../thirdparty/mongoose)

endif()

### 库文件
if(${CAL_MQTT_INCLUDE_KAWAII})
message("==========kawaii source ")
aux_source_directory(mqtt_kawaii/kwaii-mqtt/mqtt MQTT_MQTT)
#add_subdirectory(mqtt_kawaii/kwaii-mqtt)
#link_directories(mqtt_kawaii/kawaii-mqtt/build/lib)
#link_libraries(kawaii_mqtt)
SET(MQTT_SRC ${MQTT_MQTT})

elseif(${CAL_MQTT_INCLUDE_PAHO})
message("==========paho source ")
aux_source_directory(mqtt_paho/paho.mqtt.c/src  MQTT_SRC)

elseif(${CAL_MQTT_INCLUDE_MODEM})
message("==========modem source ")
aux_source_directory(mqtt_modem/mqtt_modem.c   MQTT_SRC)
  
elseif(${CAL_MQTT_INCLUDE_MONGOOSE})
message("==========mongoose source ")
aux_source_directory(mqtt_mongoose MQTT_SRC)

else()

endif()


add_library(
        pmqtt STATIC  
        ${MQTT_SRC})

SET(TEST_FILE mqtt_test.c)
link_libraries(plum)
link_libraries(pmqtt)
link_libraries(log)
link_libraries(mongoose)

add_executable(mqtt.run 
            ${TEST_FILE})

